<?php
class smarty_ext_forum {

	function smarty_ext_forum() {
		global $setupdata, $mysqlclass, $forumclass;
		$this->setupdata=$setupdata;
		$this->mysqlclass=$mysqlclass;
		$this->forumclass=$forumclass;
	}
	
	function get_all_forum_groups(){
		return $this->forumclass->get_all_forums();
	}
	
	function get_forum_data($params){
		if ((isset($params['group']) && (strlen($params['group']) > 0))){
			return $this->forumclass->get_forum_data($params['group']);
		}
	}
	
	function get_post_fields(){
		return $this->forumclass->get_post_fields();
	}
	
	function get_forum_subjects($params){
		if ((isset($params['group']) && (strlen($params['group']) > 0))){
			return $this->forumclass->get_forum_subjects($params['group']);
		}
	}

	function get_subject_data($params){
		if (isset($params['subject']) && (strlen($params['subject']) > 0)){
			if (!isset($params['sort'])) return $this->forumclass->get_subject_data($params['subject']);
			elseif (($params['sort'] == '+') or ($params['sort'] == '-')) return $this->forumclass->get_subject_data($params['subject'], $params['sort']);
		}
	}
}
?>